/**   
 * @Title: UsersService.java
 * @Package com.wx
 * @Description: 
 * @author wangxiao
 * @date 2017年11月7日 下午2:24:31
 */
package com.wx.service;

import java.util.List;

import com.wx.model.WxAccount;

/**   
 * @ClassName: UsersService
 * @Description: 
 * @author wangxiao
 * @date 2017年11月7日 下午2:24:31
 */
public class AccountService {
	public static final AccountService me = new AccountService();
	private final WxAccount accountDao = new WxAccount().dao();
	
	public List<WxAccount> getAllAccountList(){
		List<WxAccount> accountList = accountDao.find("select * from wx_account");
		return accountList;
	}
	
	public WxAccount getAccountByAppid(String appid){
		WxAccount acc = accountDao.findFirst("select * from wx_account d where d.appid = ? and d.app_type is null",appid);
		return acc;
	}
	public WxAccount getAccountByAppid(String appid,String apptype){
		WxAccount acc = accountDao.findFirst("select * from wx_account d where d.appid = ? and d.app_type =?", appid,apptype);
		return acc;
	}
	
}
